﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master" CodeBehind="Maintenance_Wharf.aspx.vb" Inherits="I_PORT.Maintenance_Wharf" 
    title="IRPC INTELLIGENT PORT SERVICE" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <script type="text/javascript" language="javascript">
    var _source;
    // keep track of the popup div
    var _popup;

    function showConfirm(customerid) {
        this._source = customerid;
        this._popup = $find('ModalPopupExtender3'); 
        this._popup.show();  
    }
       function okClick(){
        //  find the confirm ModalPopup and hide it
       this._popup.hide();

        __doPostBack(this._source.name,'');
    }
    
    function cancelClick(){
        //  find the confirm ModalPopup and hide it
        this._popup.hide();
    }
 </script>
<asp:UpdatePanel ID="Update1" runat="server">
  <ContentTemplate>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>
             <asp:Panel ID="PanelHome" runat="server" >
     <table width="100%" border="0" cellpadding="2" cellspacing="0">
        <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label6" runat="server" SkinID="lbtxt" Text="PORT :"></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:RadioButtonList ID="radioPortSearch" runat="server" AutoPostBack="true" SkinID="raio">
                                   <asp:ListItem Value="L" Selected="True">Liquid</asp:ListItem>
                                   <asp:ListItem Value="B">Bulk</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label7" runat="server" SkinID="lbtxt" Text="Wharf :"></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:DropDownList ID="ddlWharfSearch" runat="server" SkinID="ddl" >
                                   <asp:ListItem Value="0"><--Select Wharf--></asp:ListItem>
                                </asp:DropDownList><asp:Button ID="btnSearch" runat="server" CssClass="ButtonStyle" Text="Search" />
                            </td>
                     </tr>
        <tr>
           <td style="height:5px;"><img src="../Image/space.gif" /></td>
        </tr>
        <tr>
           <td align="center" colspan="2">
              <asp:UpdatePanel ID="updatePanelGrid" runat="server" UpdateMode="Conditional"><ContentTemplate>
              <asp:GridView ID="gridMaintenance" runat="server" SkinID="gridblue"  DataKeyNames="Wharf,Date_From,Date_to,TimeStart,TimeEnd,Booking_no,BookingWharf,PORT,Remark"
                     AutoGenerateColumns="False">
                     <PagerTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="ImgFirst" runat="server" Height="22px" ImageUrl="../Image/arrow-first.gif"
                                                            OnCommand="Paginate" CommandArgument="First" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                    </td>
                                                    <td valign="top">
                                                        Page
                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        of
                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </PagerTemplate>
                     <Columns> 
                         <asp:BoundField HeaderText="WHARF" DataField="Wharf" />
                         <asp:BoundField HeaderText="DETAIL" DataField="Remark" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="BERTH DATE" DataField="Date_From" />
                         <asp:BoundField HeaderText="BERTH TIME" DataField="TimeStart" />
                         <asp:BoundField HeaderText="DEPART DATE" DataField="Date_to" />
                         <asp:BoundField HeaderText="DEPART DATE" DataField="TimeEnd" />
                         <asp:TemplateField HeaderText="แก้ไข" ItemStyle-Width="50px">
                             <ItemTemplate>
                                 <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" ImageUrl="~/Image/edit-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                        <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
               </ContentTemplate></asp:UpdatePanel>
           </td>
        </tr>
         <tr>
             <td style="width:20%;" align="right">&nbsp;</td>
             <td align="left">
             <asp:Button ID="btnMainTenance" runat="server" Width="150px" Text="New MainTenance" CssClass="ButtonStyle" />
             </td>
        </tr>
        <tr>
           <td style="height:5px;"><img src="../Image/space.gif" /></td>
        </tr>
        </table>
       </asp:Panel>
          </td>
        </tr>
        <tr>
          <td >
               <asp:Panel ID="panelMaintenance" runat="server" Visible="false">
                  <table width="100%" border="0" cellpadding="2" cellspacing="0">
                     <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label4" runat="server" SkinID="lbtxt" Text="PORT :"></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:RadioButtonList ID="radioPort" runat="server" AutoPostBack="true" SkinID="raio">
                                   <asp:ListItem Value="L" Selected="True">Liquid</asp:ListItem>
                                   <asp:ListItem Value="B">Bulk</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text="Wharf :"></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:DropDownList ID="ddlWharf" runat="server" SkinID="ddl" >
                                   <asp:ListItem Value="0"><--Select Wharf--></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label2" runat="server" SkinID="lbtxt" Text="BOOK DATE/TIME :"></asp:Label>&nbsp;</td>
                            <td align="left">
                            <asp:TextBox ID="txtBerthDate" runat="server" Width="80px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="imgBerthDate" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:TextBox ID="txtBerthTime" runat="server" Width="40px"></asp:TextBox>
             <asp:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtBerthDate" Format="dd MMM yyyy" PopupButtonID="imgBerthDate"></asp:CalendarExtender>
             <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtBerthTime"
                  Mask="99:99" MaskType="Time" AcceptNegative="Left" InputDirection="LeftToRight"></asp:MaskedEditExtender>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" align="right"><asp:Label ID="Label3" runat="server" SkinID="lbtxt" Text="FINISH DATE/TIME :"></asp:Label>&nbsp;</td>
                            <td align="left">
                            <asp:TextBox ID="txtDepartDate" runat="server" Width="80px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="imgDepartDate" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:TextBox ID="txtDepartTime" runat="server" Width="40px"></asp:TextBox>
             <asp:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtDepartDate" Format="dd MMM yyyy" PopupButtonID="imgDepartDate"></asp:CalendarExtender>
             <asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="txtDepartTime"
                  Mask="99:99" MaskType="Time" AcceptNegative="Left" InputDirection="LeftToRight"></asp:MaskedEditExtender>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" valign="top" align="right"><asp:Label ID="Label5" runat="server" SkinID="lbtxt" Text="Detail :"></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:TextBox ID="txtRemark" runat="server" Width="90%" Height="50px" TextMode="MultiLine" ></asp:TextBox>
                            </td>
                     </tr>
                     <tr>
                            <td style="width:20%;" align="right">&nbsp;</td>
                            <td align="left">
                                <asp:Button ID="btnSave" runat="server" Text="บันทึก" CssClass="ButtonStyle" />
                                <asp:Button ID="btnConfirm" runat="server" Text="Confirm" Visible="false" CssClass="ButtonStyle" />
                                <asp:Button ID="btnCLose" runat="server" Text="กลับ" CssClass="ButtonStyle" />
                            </td>
                     </tr>
                  </table>
               </asp:Panel>
          </td>
        </tr>
       </table>
       <asp:Button ID="BtnTrigger" runat="server" style="display:none;" />
        <asp:ModalPopupExtender ID="ModalPopupExtender3" BehaviorID="ModalPopupExtender3" runat="server" 
                                    OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" 
                                    OnOkScript="okClick();" 
                                    CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo"     
                                    OnCancelScript="cancelClick();" 
                                     BackgroundCssClass="Background" DropShadow="false" 
                                      PopupControlID="PanelConfirm" TargetControlID="BtnTrigger" >
        </asp:ModalPopupExtender>
     <asp:Panel ID="PanelConfirm" runat="server" style="display:none;">
       <Confirm:Confirm1 ID="ConfirmDelete" runat="server" ></Confirm:Confirm1>
    </asp:Panel>
    </ContentTemplate>
 </asp:UpdatePanel>
</asp:Content>
